<?php
/**
 * CEOfox
 *
 * @copyright  Copyright 2011-2012 CEOfox, Inc.
 * @license    http://ceofox.com/pages/license
 * @version    $Id: tab.class.php 47088 2013-05-24 09:40:17 $
 * @author     CEOfox, Inc.
 */
?>
<?php
defined('PHPFOX') or exit('NO DICE!');
class Follow_Component_Block_Tab extends Phpfox_Component
{
    public function process()
    {
        $aUser = $this->getParam('aUser');
        $sType = $this->getParam('type_id', 'user');
        $bIsLogin = (phpfox::getUserid() > 0 ?true:false);
        $bIsCurrentUser = false;
        if(!isset($aUser) or $aUser['user_id'] == phpfox::getUserid())
        {
            $aUser['user_id'] = phpfox::getUserId();
            $bIsCurrentUser = true;
        }
        phpfox::getService('follow')->checkBlockUser($aUser['user_id']);
        $bIsBlockAll = phpfox::getservice('follow')->isBlockAll($aUser['user_id']);
        $iFollowers = phpfox::GetService('follow')->countFollower($aUser['user_id']);
        $iFollowing = phpfox::GetService('follow')->countFollowing($aUser['user_id']);
        $iBlockers = Phpfox::GetService('follow')->countBlocker($aUser['user_id']);
        
        $this->template()->setHeader('jquery/ui.js', 'static_script');
        $this->template()->setHeader('cache', array(
                       
                    'friend.js' => 'module_friend',
                    'follow.js' => 'module_follow',
                    'friend.css' => 'style_css',
                    'follow.css' => 'module_follow'
                )
        ); 
        $this->template()->assign(array(
            'sHeader' => Phpfox::getPhrase('follow.follow_information'),
            'sCoreUrl' =>phpfox::getParam('core.path'),
            'iFollowers' => $iFollowers,
            'iFollowing'=> $iFollowing,
            'iBlockers' => $iBlockers,
            'bIsLogin' => $bIsLogin,
            'bIsBlockAll' => $bIsBlockAll,
            'sType' => $sType,
            'aUser' => $aUser
        ));
        return 'block';
    }
}

?>
